module.exports = (app) => {
    const { STRING, INTEGER, DATE } = app.Sequelize;

    const PersonCertificate = app.model.define(
        "person-certificate",
        {
            id: {
                type: INTEGER,
                primaryKey: true,
                autoIncrement: true,
            },
            name: {
                type: STRING(255), // 姓名长度调整为255，且不允许为空
                allowNull: false,
            },
            gender: {
                type: STRING(255), // 性别
            },
            idNumber: {
                type: STRING(255), // 身份证号
            },
            certificateName: {
                type: STRING(255), // 证书名称
            },
            certificateNumber: {
                type: STRING(255), // 证书编号
                allowNull: false,
                unique: true,
            },
            certificateLevel: {
                type: STRING(255), // 证书等级，
            },
            workUnit: {
                type: STRING(255), // 工作单位
            },
            position: {
                type: STRING(255), // 职务
            },
            isDeleted: {
                type: INTEGER,
                defaultValue: 0,
            },
            createdAt: {
                type: DATE,
                allowNull: true,
            },
            updatedAt: {
                type: DATE,
                allowNull: true,

            },

        },
        {
            timestamps: true,
            underscored: false,
        }
    );

    return PersonCertificate;
};